# _*_ coding: utf-8 _*_
from odoo import models, fields, api


class PurchaseOrder(models.Model):
    _inherit = "purchase.order"

    purchase_order_type_id = fields.Many2one("purchase.order.type", string="Purchase Order Type")

    @api.onchange("purchase_order_type_id")
    @api.multi
    def get_picking_order_type(self):
        for order in self:
            order.picking_type_id = order.purchase_order_type_id.picking_type_id
